adding functions for interacting with execution context #221
+58
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request adds new FFI (Foreign Function Interface) wrappers and Rust-side helpers for working with PHP internals, particularly around function and execution context introspection. The changes improve the ability to interact with PHP's call stack, function flags, and class scopes from Rust code, and also provide more ergonomic and safe APIs.
New PHP internals FFI wrappers:
phper_zval_undef
to set azval
toUNDEF
and exposed it to Rust.phper_get_called_scope
,phper_zend_call_num_args
,phper_zend_set_call_num_args
,phper_zend_call_info
,phper_zend_add_call_flag
, andphper_zend_call_may_have_undef
. Also added helpers for success/failure constants. [1] [2]Rust-side enhancements:
is_static
method toZFunc
to check if a function is static usingZEND_ACC_STATIC
.ExecuteData::get_this
andget_this_mut
to use safe pointer conversion and addedget_called_scope
to retrieve the called class scope as an optionalClassEntry
.phper/src/values.rs
to includeClassEntry
for new functionality.